package tankgame6;

import java.util.Vector;

public class SuperMan extends Tank {
    /**
     * 定义全部变量
     */
    Shot shot = null;
    Vector<Shot> shots = new Vector<>();

    public SuperMan(int x, int y) {
        super(x, y);
    }

    public void shotEnemyTank() {
        if (shots.size() == 5)
            return;//最多打5个子弹
        switch (getDirect()) {   //这也行？？？？？？？？？？
            case 0://up
                shot = new Shot(getX() + 10, getY(), 0);
                break;
            case 1://right
                shot = new Shot(getX() + 60, getY() + 20, 1);
                break;
            case 2://down
                shot = new Shot(getX() + 20, getY() + 60, 2);
                break;
            case 3://left
                shot = new Shot(getX(), getY() + 20, 3);
                break;
        }//switch
        shots.add(shot);
        new Thread(shot).start();
    }
}
